﻿Imports Entidad
Imports System.Data
Imports System.Data.SqlClient

Public Class DocumentoClienteAprobacionDatos

    Function ListarDocumentosAprobar() As DataSet
        Dim conex As New Conexion
        Dim coneccion As SqlConnection = conex.conectar()
        coneccion.Open()
        'Se Cargan los pedidos Comprometidos
        Dim query As String = "SELECT Doc.DCI_Codigo As 'Pedido',Doc.DCI_Fecha As 'Fecha',Pro.PRC_Descripcion As 'Procedencia', " &
                               "Doc.CNV_Codigo As 'CVta',Doc.CLI_Codigo As 'Codigo',CLI.CLI_Descripcion As 'Cliente', " &
                               "Mon.Mon_Abreviatura As 'Moneda',Doc.DCI_TotalCobrar As 'Total' " &
                               "FROM Documento_Cliente Doc " &
                               "LEFT JOIN Cliente Cli ON Cli.CLI_Codigo=Doc.CLI_Codigo " &
                               "LEFT JOIN ProcedenciaCliente Pro ON Pro.PRC_Codigo=Cli.PRC_Codigo " &
                               "LEFT JOIN Moneda Mon ON Mon.MON_Codigo=Doc.MON_Codigo "

        Dim adapter As New SqlDataAdapter(query, coneccion)
        Dim ds As New DataSet
        adapter.Fill(ds)
        coneccion.Close()

        Return ds
    End Function

End Class
